<div id="steps" class="form complex">
    <?php
    echo form_open('peserta/peserta_fix/save_plot_kamar');
    ?>
    <form >
        <fieldset class="step">
            <?
            //----Start Print Cow------
            $no = 1;
            $status = 0;
            $counter_nokamar = 1;
            foreach ($plot_kamar_peserta_cow->result() as $row) {
                if ($no > 2) {
                    $no = 1;
                }

                $status++;
                if($row->NAMA_PANGGILAN == '0'){
                    $nama_peserta = "";
                }
                $nama_peserta = $row->NAMA_PANGGILAN.' / '.$row->ID_PESERTA;
                echo'
                        <p>
                        <label>Peserta ' . $no . '</label>
                        <input id="peserta_1" name="peserta' . $status . '" type="text" value="' . $nama_peserta . '" tabindex="1" />
			</p>
                        ';
                if ($no == 2) {
                    echo'
                        <p>
                        <label>No Kamar</label>
                        <input id="kamar" name="no_kamar' . $counter_nokamar . '" type="text" value="" size="20" tabindex="2" />
                        </p>
						----------------------------------------------------------
                        ';
                    $counter_nokamar++;
                }
                $no++;
            }
            if ($status % 2 == 1) {
                echo'
                        <p>
                        <label>Peserta 2</label>
                        <input id="peserta_1" name="peserta_1" type="text" value="" tabindex="1" />
			</p>
                        <p>
                        <label>No Kamar</label>
                        <input id="kamar" name="no_kamar' . $counter_nokamar . '" type="text" value="" size="20" tabindex="2" />
                        </p>
						----------------------------------------------------------
                        ';
            }

            



            //----Start Print Cew------
            $no_cew = 1;
            $status_cew = 0;
            
            if($status %2 == 1){
                $status = $status+1;
                $counter_nokamar = $counter_nokamar+1;
            }
            
            //$status = $status+1;
            
            foreach ($plot_kamar_peserta_cew->result() as $row) {
                if ($no_cew > 2) {
                    $no_cew = 1;
                }
                
                $status++;
                if($row->NAMA_PANGGILAN == '0'){
                    $nama_peserta_cew = "";
                }
                $nama_peserta_cew = $row->NAMA_PANGGILAN.' / '.$row->ID_PESERTA;
                echo'
                        <p>
                        <label>Peserta ' . $no_cew . '</label>
                        <input id="peserta_1" name="peserta' . $status . '" type="text" value="' . $nama_peserta_cew . '" tabindex="1" />
			</p>
                        ';
                if ($no_cew == 2) {
                    echo'
                        <p>
                        <label>No Kamar</label>
                        <input id="kamar" name="no_kamar' . $counter_nokamar . '" type="text" value="" size="20" tabindex="2" />
                        </p>
						----------------------------------------------------------						
                        ';
                    $counter_nokamar++;
                }
                $no_cew++;
                $status_cew++;
            }
            if ($status_cew % 2 == 1) {
                echo'
                        <p>
                        <label>Peserta 2</label>
                        <input id="peserta_1" name="peserta_1" type="text" value="" tabindex="1" />
			</p>
                        <p>
                        <label>No Kamar</label>
                        <input id="kamar" name="no_kamar' . $counter_nokamar . '" type="text" value="" size="20" tabindex="2" />
                        </p>   
						----------------------------------------------------------
                        ';
            }
            
            
            echo'
                        <input type="hidden" name="status" value="' . $status . '">
                ';
            ?>
            <p class="submit">
                <button id="registerButton" type="submit">Simpan</button>&nbsp;
                <button id="registerButton" type="reset">Reset</button>&nbsp;
                <button id="registerButton" TYPE="BUTTON" VALUE="Back" ONCLICK="window.location.href='<?=base_url()?>index.php/peserta/peserta_fix/daftar/<?=$this->session->userdata('id_batch')?>'">Kembali</button>
            </p >
        </fieldset>
        <?php
        echo form_close();
        ?>
    </form> 
</div>